# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataform.V1beta1.Model.CodeCompilationConfig do
  @moduledoc """
  Configures various aspects of Dataform code compilation.

  ## Attributes

  *   `assertionSchema` (*type:* `String.t`, *default:* `nil`) - Optional. The default schema (BigQuery dataset ID) for assertions.
  *   `databaseSuffix` (*type:* `String.t`, *default:* `nil`) - Optional. The suffix that should be appended to all database (Google Cloud project ID) names.
  *   `defaultDatabase` (*type:* `String.t`, *default:* `nil`) - Optional. The default database (Google Cloud project ID).
  *   `defaultLocation` (*type:* `String.t`, *default:* `nil`) - Optional. The default BigQuery location to use. Defaults to "US". See the BigQuery docs for a full list of locations: https://cloud.google.com/bigquery/docs/locations.
  *   `defaultNotebookRuntimeOptions` (*type:* `GoogleApi.Dataform.V1beta1.Model.NotebookRuntimeOptions.t`, *default:* `nil`) - Optional. The default notebook runtime options.
  *   `defaultSchema` (*type:* `String.t`, *default:* `nil`) - Optional. The default schema (BigQuery dataset ID).
  *   `schemaSuffix` (*type:* `String.t`, *default:* `nil`) - Optional. The suffix that should be appended to all schema (BigQuery dataset ID) names.
  *   `tablePrefix` (*type:* `String.t`, *default:* `nil`) - Optional. The prefix that should be prepended to all table names.
  *   `vars` (*type:* `map()`, *default:* `nil`) - Optional. User-defined variables that are made available to project code during compilation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assertionSchema => String.t() | nil,
          :databaseSuffix => String.t() | nil,
          :defaultDatabase => String.t() | nil,
          :defaultLocation => String.t() | nil,
          :defaultNotebookRuntimeOptions =>
            GoogleApi.Dataform.V1beta1.Model.NotebookRuntimeOptions.t() | nil,
          :defaultSchema => String.t() | nil,
          :schemaSuffix => String.t() | nil,
          :tablePrefix => String.t() | nil,
          :vars => map() | nil
        }

  field(:assertionSchema)
  field(:databaseSuffix)
  field(:defaultDatabase)
  field(:defaultLocation)

  field(:defaultNotebookRuntimeOptions,
    as: GoogleApi.Dataform.V1beta1.Model.NotebookRuntimeOptions
  )

  field(:defaultSchema)
  field(:schemaSuffix)
  field(:tablePrefix)
  field(:vars, type: :map)
end

defimpl Poison.Decoder, for: GoogleApi.Dataform.V1beta1.Model.CodeCompilationConfig do
  def decode(value, options) do
    GoogleApi.Dataform.V1beta1.Model.CodeCompilationConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataform.V1beta1.Model.CodeCompilationConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
